﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DaoRuShiTi.aspx.cs" Inherits="Admin_tiku_DaoRuShiTi" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="~/css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="m_box">
        <div class="m_head">
            从Excel表导入试题</div>
        <div class="m_middle">
            <div class="m_m_c" style="width: 160px;">
                <span>导入试题所属的课程</span></div>
            <div class="m_m_c">
                <asp:DropDownList ID="DropDownList1" runat="server" Width="100px" Height="23px" DataSourceID="SqlDataSource1"
                    DataTextField="c_name" DataValueField="c_id">
                </asp:DropDownList>
            </div>
            <div class="m_m_c" style="width: 250px;">
                <asp:Label ID="Label1" runat="server" Text="导入的题型" Width="100px"></asp:Label>
                <asp:DropDownList ID="DropDownList2" runat="server" Height="23px" Width="100px">
                    <asp:ListItem>单选题</asp:ListItem>
                    <asp:ListItem>多选题</asp:ListItem>
                    <asp:ListItem>判断题</asp:ListItem>
                    <asp:ListItem>简答题</asp:ListItem>
                    <asp:ListItem>论述题</asp:ListItem>
                </asp:DropDownList>
            </div>
        </div>
        <div class="m_middle">
            <div class="m_m_c" style="width:180px">
                <asp:Label ID="Label2" runat="server" Text="请选择要导入的Excel表"></asp:Label>
            </div>
            <div class="m_m_c" style="width:350px">
                <asp:FileUpload ID="FileUpload1" runat="server" />
            </div>
            <div class="m_m_c">
                <asp:Button ID="Button2" runat="server" Text="导 入" Width="80px" 
                    onclick="Button2_Click" />
            </div>
        </div>
        <div class="m_content">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
                BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black"
                GridLines="Horizontal" Height="16px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                Width="1174px" AllowPaging="True" DataKeyNames="ID">
                <Columns>
                    <asp:TemplateField HeaderText="选择">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                        <ItemStyle Width="90px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="Title" HeaderText="题目" />
                    <asp:BoundField DataField="Answer" HeaderText="答案" />
                    <asp:HyperLinkField HeaderText="编辑" Text="编辑" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="ChangeDanXuan.aspx?ID={0}">
                        <ItemStyle Width="100px" />
                    </asp:HyperLinkField>
                    <asp:TemplateField HeaderText="删除" ShowHeader="False">
                        <ItemTemplate>
                            <asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Delete"
                                Text="删除" OnClientClick="return confirm('您确认删除该记录吗?')" />
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                </Columns>
                <RowStyle HorizontalAlign="Center" />
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle BackColor="#3a9cff" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
        </div>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ksConnectionString %>"
        SelectCommand="SELECT [c_id], [c_name] FROM [Course]"></asp:SqlDataSource>
    </form>
</body>
</html>
